package cn.com.headfree.technician.dao.impl;

import cn.com.headfree.entity.*;
import cn.com.headfree.technician.dao.TSeniorTechnicianHandleDao;
import com.gta.edu.sdk.base.dao.impl.BaseDaoImpl;
import org.apache.commons.lang.StringUtils;
import org.springframework.stereotype.Repository;

import java.util.HashMap;
import java.util.Map;

@Repository("tSeniorTechnicianHandleDao")
public class TSeniorTechnicianHandleDaoImpl extends BaseDaoImpl<TSeniorTechnicianHandle> implements TSeniorTechnicianHandleDao {


    @Override
    public void saveInfo(TSeniorTechnicianHandle tSeniorTechnicianHandle) {
        this.save(tSeniorTechnicianHandle);
    }

    @Override
    public void deleteInfo(TSeniorTechnicianHandle tSeniorTechnicianHandle) {
        String sql = "delete from t_senior_technician_handle ";
        StringBuilder sqlBuilder = new StringBuilder(sql);
        sqlBuilder.append(" where 1=1 ");
        Map<String, Object> params = new HashMap<String, Object>();
        sqlBuilder.append(" and erp_no=#{erpNo,jdbcType=VARCHAR}");
        params.put("erpNo",tSeniorTechnicianHandle.getErpNo());
        sqlBuilder.append(" and business_id=#{businessId,jdbcType=VARCHAR}");
        params.put("businessId", tSeniorTechnicianHandle.getBusinessId());
        this.executeSql(sqlBuilder.toString(), params);
    }
}
